Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a bindgen test that exercises using error types from a different interface #6802

Conversation

elliottt
Copy link
Member

@elliottt elliottt commented Aug 3, 2023

Add a test for the changes in #6795 to trappable_error_type argument of the host bindgen! macro. The test uses an error type defined in a different interface as a trappable_error_type, and verifies that the code generator handles that by lifting those result types into anyhow::Error.

The component introduced in this test doesn't make use of multiple modules, and is a complete copy of the component used in the previous enum_error test. This works out because of subtyping, but still allows us to test the interface generated by the bindgen! macro.

@elliottt elliottt requested a review from a team as a code owner August 3, 2023 22:37
@elliottt elliottt requested review from alexcrichton and pchickey and removed request for a team August 3, 2023 22:37
@alexcrichton alexcrichton added this pull request to the merge queue Aug 4, 2023
Merged via the queue into bytecodealliance:main with commit de4ede0 Aug 4, 2023
19 checks passed
geekbeast pushed a commit to geekbeast/wasmtime that referenced this pull request Aug 6, 2023
… feature/preview2

* 'feature/preview2' of github.com:geekbeast/wasmtime:
  Change preview2 builder methods to use `&mut self` (bytecodealliance#6770)
  Add a bindgen test that exercises using error types from a different interface (bytecodealliance#6802)
  Resolve trappable error types with fully qualified package paths (bytecodealliance#6795)
  Update the dev-dependency for wit-bindgen to 0.9.0 (bytecodealliance#6800)
  Fix incorrect sample code in documentation (bytecodealliance#6796) (bytecodealliance#6797)
  Update preview1 to trap on misaligned pointers (bytecodealliance#6776)
  Fix posix-signals-on-macos on aarch64-apple-darwin (bytecodealliance#6793)
  consistient WASI preview1 rights reporting (bytecodealliance#6784)
  Wasmtime: Introduce `{Module,Component}::resources_required` (bytecodealliance#6789)
eduardomourar pushed a commit to eduardomourar/wasmtime that referenced this pull request Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants